package com.longrise.android.byjk.plugins.dealsituation.course.video2.dialog;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.longrise.android.byjk.R;
import com.longrise.common.utils.AppBaseDialog;

/**
 * Created by godliness on 2017/9/19.
 */

public class CurrencyDialog extends AppBaseDialog implements View.OnClickListener {

    private TextView mTitle;
    private TextView mContent;
    private TextView mCancle;

    /**
     * 默认为InPutDialog style
     *
     * @param context
     */
    public CurrencyDialog(Context context) {
        super(context, R.style.VideoListDialog);
    }

    @Override
    public int getLayoutResourceId(Bundle bundle) {
        return R.layout.dialog_type_thr;
    }

    @Override
    public void init() {
        mTitle = (TextView) findViewById(R.id.dialog_hint);
        mContent = (TextView) findViewById(R.id.tv_dg_msg);
        mCancle = (TextView) findViewById(R.id.tv_back_upload);

        setTitle("温馨提示");
        setContent("该课件已通过\n继续学习，后面内容更精彩哟");
        setBtnText("我知道了");
    }

    public void setTitle(String title) {
        if (mTitle != null) {
            mTitle.setText(title);
        }
    }

    public void setContent(String content) {
        if (mContent != null) {
            mContent.setText(content);
            mContent.setTextColor(Color.parseColor("#FF9900"));

        }
    }

    public void setBtnText(String text) {
        if (mCancle != null) {
            mCancle.setText(text);
        }
    }

    @Override
    public void regEvent() {
        if (mCancle != null) {
            mCancle.setOnClickListener(this);
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_back_upload:
                dismiss();
                break;

            default:
                break;
        }
    }

}
